package com.example.designpattern.creator.factory;

/**
 * ADVANTAGES
 * 	- 
 * 
 */
public class CarFactory {

	public static Car buildCar(CarType model) {
		Car car = null;
		switch (model) {
		case SMALL:
			car = new SmallCar();
			break;
		case SEDAN:
			car = new SedanCar();
			break;
		case LUXURY:
			car = new LuxuryCar();
			break;
		default:
			//throws exception;
			break;
		}
		return car;
	}
	
	public static void main(String[] args) {
		CarFactory.buildCar(CarType.LUXURY);
		CarFactory.buildCar(CarType.SMALL);
		CarFactory.buildCar(CarType.SEDAN);
	}
}
